package swing.ui;

import java.awt.Component;

import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;

import action.vo.IdName;

@SuppressWarnings("serial")
public class IdNameListCellRenderer extends DefaultListCellRenderer{
	
	public Component getListCellRendererComponent(   
            JList list,   
            Object value,   
            int index,   
            boolean isSelected,   
            boolean cellHasFocus) {   
    	
        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);   
        if (value instanceof IdName) {   
            IdName item = (IdName) value;  
            this.setText(item.getName());
        }
        if(value==null){
        	this.setText("");
        }
        return this;   
    }
}
